<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>

<%@page import="com.bban.util.StringUtil"%>
<%@page import="org.apache.log4j.Logger"%>
<%@page import="com.bban.dto.vo.*"%>
<%@page import="com.bban.db.dao.*"%>
<%@page import="com.bban.entry.UserCenter2"%>
<%@page import="com.bban.util.cfg.DBCfg"%>
<%@page import="com.bban.dto.base.Msg"%>
<%@page import="com.bban.bo.*"%>
<%

String eBabyID = (String)session.getAttribute("eBabyID");
//long ePlayerID = Long.parseLong((String)session.getAttribute("ePlayerID"));
//EbabyUser bUser = new EbabyUser();
%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>谷米科技-索米克手机服务平台</title>
  <link rel="stylesheet" href="css/smk_comm.css" />
	<link rel="stylesheet" type="text/css" href="Ext/resources/css/ext-all.css" />
	<script type="text/javascript" src="Ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="Ext/ext-all.js"></script>
	<script type="text/javascript" src="charts/swfobject.js"></script>
	<script type="text/javascript">
		var dataType=Ext.data.Record.create([
	    	{name: 'userid'},//用户名
        {name: 'jd', type: 'float'},//经度
        {name: 'wd', type: 'float'},//纬度
        {name: 'dw_time', type: 'float'},//定位时间
        {name: 'sd'},//速度
        {name: 'xt_time'}//系统时间
	    ]);
			
	    function addMsg(elements){
	    		if(!Ext.getCmp('mess').getStore().getAt(0)
	    			||Ext.getCmp('mess').getStore().getAt(0).get('dw_time')!=elements[2]
	    			||Ext.getCmp('mess').getStore().getAt(0).get('xt_time')!=elements[7])
	    		{
		    		Ext.getCmp('mess').getStore().insert(0,new dataType
		    		({
				    	userid:elements[4],
				    	jd:elements[0],
				    	wd:elements[1],
				    	dw_time:elements[2],
				    	sd:elements[3],
				    	xt_time:elements[7]
			    	}));
			    	if(Ext.getCmp('mess').store.getCount()>100){
			    		Ext.getCmp('mess').store.removeAt(100);
			    	}
			    	//Ext.getCmp('mess').getStore().reload();
	    		}
	    }
	
    Ext.onReady(function(){
	    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
	    var data=[];
	    var store = new Ext.data.Store({
	        reader:new Ext.data.ArrayReader({},dataType),
					data:data,
					sortInfo :{field: "xt_time", direction: "DESC"}//倒序排列
	    });
      var viewport = new Ext.Viewport({
         layout:'border',
         items:[
             new Ext.BoxComponent({
                 region:'north',
                 el: 'top_container',
                 height:73
             }),
             new Ext.grid.GridPanel({
          			region:'south',
						height:180,
						id:'mess',
						collapsible :true,
		        store : store,
		        stripeRows: true,
		        autoExpandColumn: 'company',
		        width:'100%',
		        title:'用户详细信息列表',
		        columns: [
		        		//new Ext.grid.RowNumberer({
		        			//header:"行号",
		        			//width:40
		        		//}),
		            {id:'company',header: "用户名", width: 160, sortable: true, dataIndex: 'userid'},
		            {header: "经度", width: 80, sortable: true, dataIndex: 'jd'},
		            {header: "纬度", width: 80, sortable: true, dataIndex: 'wd'},
		            {header: "定位时间", width: 80, sortable: true,dataIndex: 'dw_time'},
		            {header: "速度", width: 90, sortable: true, dataIndex: 'sd'},
		            {header: "服务器接收时间", width: 105, sortable: true, dataIndex: 'xt_time'}
		        ],
		        viewConfig: {
	            forceFit:true,
	            enableRowBody:true,
	            showPreview:true
	        	}
	        	//,tbar:pagingBar,
	        	//tbar:toolbar
					 }),{
                 region:'west',
                 id:'west-panel',
                 title:'导航栏',
                 split:true,
                 width: 260,
                 minSize: 240,
                 maxSize: 300,
                 collapsible: true,
                 margins:'0 3 0 0',
                 layoutConfig:{
                 		border:false,
                     animate:true
                 },
                 items: [
                 	new Ext.Panel({
									title : '卫星信号信息',
									width : 260,
									height:200,
									collapsible :true,
									border : false,
									frame : true,
									html: '<div id="chart"/>'
							}),new Ext.Panel({
									title : '电量信息',
									defaults :{bodyStyle:'padding-left:55px;padding-top:10px'},
									collapsible :true,
									border :false,
									items:[{contentEl: 'power',border :false}]
							})]
             },
             new Ext.TabPanel({
                 region:'center',
                 activeTab:0,
                 items:[
                 	new Ext.Panel({
									title : '   地 图 信 息   ',
									contentEl : 'maps'//加载本地资源
								}),
								new Ext.Panel({
									title : '   轨 迹 回 放   ',
									contentEl : 'gj'//加载本地资源
								})
                 ]
             })
          ]
        });
        
				var so = new SWFObject("charts/amcolumn.swf", "amcolumn1", "245", "160", "5", "#FFFFFF");
				so.addVariable("path", "charts/");
				so.addVariable("settings_file", encodeURIComponent("charts/amcolumn_settings.xml"));
				so.addVariable("data_file", encodeURIComponent("charts/amcolumn_data1.jsp"));
				so.addVariable("preloader_color", "#999999");
				so.write("chart");
				//store.load({params:{start:0, limit:10}});
    });
	</script>
</head>
<body>
<!-- 顶部信息内容 -->
<div id='top_container'>
	<div id="logo_img"></div>
	<div id="right_img"></div>
</div>
<div id="maps">
				<iframe src="tracking.html?q=<%=eBabyID%>" style="WIDTH: 100%; HEIGHT: 100%; float:right;" scrolling="no"  frameborder="0"></iframe>
</div>
<div id="power">
	<img src="images/dl.gif" />
</div>
<div id="gj">
				<iframe src="track-history.jsp?objectID=<%=eBabyID%>" style="WIDTH: 100%; HEIGHT: 100%; float:right;" scrolling="no"  frameborder="0"></iframe>
</div>
</body>
</html>


